Hi <%= @user.email %>,

This is a receipt for your Feedbin account. Please reply to this email if you have any questions.

You can view a detailed printable receipt here: <%= billing_event_url(@billing_event) %>

Thanks for being a Feedbin customer!

<%= Time.at(@billing_event.event_object["created"]).to_formatted_s(:date) %>
-------------------------------------------------
<%- @billing_event.invoice_items["data"].each do |invoice_item| %>
<%- if invoice_item["plan"] %>
Description: Subscription to <%= invoice_item["plan"]["id"] %>
<%- else %>
Description: <%= invoice_item["description"] %>
<%- end %>
Price: <%= invoice_item["currency"].upcase %> <%= number_to_currency(invoice_item["amount"].to_f / 100) %>
<%- end %>
<%- if @billing_event.invoice["starting_balance"] != 0 %>

Applied balance: <%= @billing_event.invoice["currency"].upcase %> <%= number_to_currency(@billing_event.invoice["starting_balance"].to_f / 100) %>
<%- end %>

Paid: <%= @billing_event.event_object["currency"].upcase %> <%= number_to_currency(@billing_event.event_object["amount"].to_f / 100) %>
-------------------------------------------------

Feedbin, Inc.
<%= business_address(:text) %>
